package com.icbc.dccsh.storm.es.bolt;

import java.util.Map;

import com.icbc.dccsh.storm.util.TupleUtils;

import backtype.storm.tuple.Tuple;

public class EsBolt extends org.elasticsearch.storm.EsBolt{

	private static final int DEFAULT_FLUSH_INTERVAL_SECS = 1;
	private int flushIntervalSecs = DEFAULT_FLUSH_INTERVAL_SECS;
	
	public EsBolt(String target) {
        super(target);
    }

    public EsBolt(String target, boolean writeAck) {
        super(target, writeAck);
    }

    public EsBolt(String target, Map configuration, int flushInterval) {
        super(target, configuration);
        this.flushIntervalSecs = flushInterval;
    }

    @Override
    public void execute(Tuple input) {
    	super.execute(input);
    }
    
    @Override
    public Map<String, Object> getComponentConfiguration() {
    	return TupleUtils.putTickFrequencyIntoComponentConfig(super.getComponentConfiguration(), flushIntervalSecs);
    }
}
